package com.info33.platform.system.controller;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.info33.platform.common.mvc.controller.BaseController;
import com.info33.platform.common.mvc.vo.Result;
import com.info33.platform.system.entity.SysUserEducation;
import com.info33.platform.system.service.SysUserEducationService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author admin
 */
@RestController
@RequestMapping("/SysUserEducation")
@Api(tags = "用户 - 教育经历")
public class SysUserEducationController extends BaseController<SysUserEducationService, SysUserEducation> {

    private final SysUserEducationService sysUserEducationService;

    @Autowired
    public SysUserEducationController(SysUserEducationService sysUserEducationService) {
        super(sysUserEducationService);
        this.sysUserEducationService = sysUserEducationService;
    }

    @GetMapping(value = "/app/echo")
    @ApiOperation(value = "app - 回显")
    public Result<List<SysUserEducation>> appEcho() {
        return Result.ok(sysUserEducationService.list(new QueryWrapper<SysUserEducation>()
                .eq("user_id", getCurrentUser().getId())));
    }

}